import { hopeTheme } from "vuepress-theme-hope";
import navbar from "./navbar.js";
import sidebar from "./sidebar.js";


export default hopeTheme({
  hostname: "",

  author: {
    name: "lin.su",
    url: "https://gitee.com/Lin_su/tudou_docs",
  },

  iconAssets: "fontawesome-with-brands",

  logo: "/logo.svg",

  repo: "https://gitee.com/Lin_su/tudou_docs.git",

  breadcrumb:false,

  lastUpdated:false,
  contributors:false,
  editLink:false,

  docsDir: "src",

  // navbar
  navbar,

  // sidebar
  sidebar,

  footer: "土豆知识文档 LIN.SU",

  displayFooter: true,
  
  encrypt: {
    config: {
      "/demo/encrypt.html": ["1234"],
    },
  },
  fullscreen: true,
  // page meta
  metaLocales: {
    editLink: "Gitee 编辑"
  },
  plugins: {
    // All features are enabled for demo, only preserve features you need here
    mdEnhance: {
      align: true,
      attrs: true,

      // install chart.js before enabling it
      // chart: true,

      codetabs: true,

      // insert component easily
      // component: true,

      demo: true,

      // install echarts before enabling it
      // echarts: true,

      figure: true,

      // install flowchart.ts before enabling it
      // flowchart: true,

      // gfm requires mathjax-full to provide tex support
      // gfm: true,

      imgLazyload: true,
      imgSize: true,
      include: true,

      // install katex before enabling it
      // katex: true,

      // install mathjax-full before enabling it
      // mathjax: true,

      mark: true,

      // install mermaid before enabling it
      // mermaid: true,

      playground: {
        presets: ["ts", "vue"],
      },

      // install reveal.js before enabling it
      // revealJs: {
      //   plugins: ["highlight", "math", "search", "notes", "zoom"],
      // },

      stylize: [
        {
          matcher: "Recommended",
          replacer: ({ tag }) => {
            if (tag === "em")
              return {
                tag: "Badge",
                attrs: { type: "tip" },
                content: "Recommended",
              };
          },
        },
      ],
      sub: true,
      sup: true,
      tabs: true,
      vPre: true,

      // install @vue/repl before enabling it
      // vuePlayground: true,
    },

    // uncomment these if you want a pwa
    pwa: {
      favicon: "/favicon.ico",
      cacheHTML: true,
      cachePic: true,
      appendBase: true,
      apple: {
        icon: "/assets/icon/logo.png",
        statusBarColor: "black",
      },
      msTile: {
        image: "/assets/icon/logo.png",
        color: "#ffffff",
      },
      manifest: {
        icons: [
          {
            src: "/assets/icon/logo.png",
            sizes: "120x120",
            purpose: "maskable",
            type: "image/png",
          },
        ],
        shortcuts: [
          {
            name: "土豆文档",
            short_name: "土豆",
            url: "/codes/",
            icons: [
              {
                src: "/assets/icon/guide-maskable.png",
                sizes: "192x192",
                purpose: "maskable",
                type: "image/png",
              },
            ],
          },
        ],
      },
    },
  },
});
